package org.yanghe.service;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * 使用 OpenFegin 进行远程调用
 */
@Component
@FeignClient(value = "CLOUD-PROVIDER",fallback = OpenFeginHystrixFallBackService.class) //服务名
public interface OpenFeginService {

    @GetMapping(value = "/provider/hello/{name}")
    public String hello(@PathVariable("name") String name);

    @GetMapping(value = "/provider/timeout/{name}")
    public String testTimeOut(@PathVariable("name") String name);


    @GetMapping(value = "/provider/hystrix/ok/{name}")
    public String providerOK(@PathVariable("name") String name);

    @GetMapping(value = "/provider/hystrix/timeout/{name}")
    public String providerTimeOut(@PathVariable("name") String name);
}
